package com.ruben.vistor.example.insurance;

/**
 * 卖保险的
 *
 * @author <achao1441470436@gmail.com>
 * @since 2021/7/18 15:27
 */
public class InsuranceSeller implements Person {

    /**
     * 访问建筑
     *
     * @param building 建筑
     * @author <achao1441470436@gmail.com>
     * @since 2021/7/18 15:47
     */
    public void visit(Building building) {
        System.out.println("开始去" + building.getName() + "推销保险！");
        building.beVisited(this);
    }

    /**
     * 访问居民楼
     *
     * @param building 居民楼
     * @author <achao1441470436@gmail.com>
     * @since 2021/7/18 15:22
     */
    @Override
    public void visit(ResidentialBuilding building) {
        building.arrived();
        System.out.println("开始推销医疗保险");
    }

    /**
     * 访问银行
     *
     * @param building 银行
     * @author <achao1441470436@gmail.com>
     * @since 2021/7/18 15:22
     */
    @Override
    public void visit(Bank building) {
        building.arrived();
        System.out.println("开始推销失窃保险");
    }

    /**
     * 访问咖啡厅
     *
     * @param building 咖啡厅
     * @author <achao1441470436@gmail.com>
     * @since 2021/7/18 15:22
     */
    @Override
    public void visit(CoffeeShop building) {
        building.arrived();
        System.out.println("开始推销火灾、洪水保险");
    }
}
